/* ---------------------------------------------------------------
** File name:		delay.c
** Brief:
** COPYRIGHT(C) ZXW 2020
** ---------------------------------------------------------------
** Module Information:
**
** Revision History ----------------------------------------------
** ---------------------------------------------------------------
**  Date        Version     Action                  Author
** ---------------------------------------------------------------
**  2019-5-17   1.0         Created
**
** ---------------------------------------------------------------
*/


/* Includes -----------------------------------------------------*/
#include "type.h"

/* Macro --------------------------------------------------------*/

/* Global Variables ---------------------------------------------*/

/* Extern -------------------------------------------------------*/

/* Functions ----------------------------------------------------*/

void delay_us( uint32_t n )
{
    while ( n-- )
    {
    	asm("nop"); asm("nop"); asm("nop"); asm("nop");
        asm("nop"); asm("nop"); asm("nop"); asm("nop");
    	asm("nop"); asm("nop");

    }
}

void delay_ms( uint32_t n )
{
    uint16_t    i = 2630;

    while ( n-- )
    {
        while( i-- )
		{
			asm("nop");
		}
		
        i = 2630;
    }
}

